from movie.models import MovieDetail
from django_filters import rest_framework as drf_filters
from rest_framework import viewsets
from rest_framework import serializers
from rest_framework import mixins

class MoviesFilter(drf_filters.FilterSet):
    class Meta:
        model = MovieDetail
        fields = ("name",'add_time')

class MoviesSerializer(serializers.ModelSerializer):
    class Meta:
        model = MovieDetail
        fields = "__all__"

class MoviesViewSet(viewsets.ReadOnlyModelViewSet):
    queryset = MovieDetail.objects.all()
    serializer_class = MoviesSerializer
    filter_backends = (drf_filters.DjangoFilterBackend,)
    filter_class = MoviesFilter
